package com.example.jmx.controller;

import com.example.jmx.common.properties.MyProperties;
import com.example.jmx.vo.SwitchVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {
    private final SwitchVO switchVO;
    private final MyProperties myProperties;

    public DemoController(SwitchVO switchVO, MyProperties myProperties) {
        this.switchVO = switchVO;
        this.myProperties = myProperties;
    }

    @GetMapping("/dynamicUpdateBean")
    public String dynamicUpdateBean() {
        return switchVO.toString() + "\n" + myProperties.toString();
    }
}
